翻訳と辞書
Words near each other
・ Yocoboué
・ Yocon
・ Yocona Area Council
・ Yocrunch
・ Yoctangee Park
・ Yocto Project
・ Yocto-
・ Yoctometre
・ Yocum
・ Yocón
・ Yod
・ Yod (astrology)
・ Yoda
・ Yoda (disambiguation)
・ Yoda (song)
Yoda conditions
・ YODA Project
・ Yoda purpurata
・ Yodagannawa
・ Yodai Enoshita
・ Yoddha (2014 film)
・ Yoddha (comics)
・ Yodel (company)
・ Yodel Australia
・ Yodel the Cowboy Way
・ Yodelice
・ Yodelin' Kid from Pine Ridge
・ Yodelin' Slim Clark
・ Yodeling
・ Yodeling Yokels


Dictionary Lists
翻訳と辞書 辞書検索 [ 開発暫定版 ]
スポンサード リンク

Yoda conditions : ウィキペディア英語版
Yoda conditions

In programming jargon, Yoda conditions (also called ''Yoda notation'') is a programming style where the two parts of an expression are reversed from the typical order in a conditional statement. A yoda condition places the constant portion of the expression on the left side of the conditional statement. The name for this programming style is derived from the ''Star Wars'' character named Yoda, who spoke English in a non-standard syntax.
Yoda conditions are part of the WordPress 〔https://make.wordpress.org/core/handbook/coding-standards/php/#yoda-conditions〕 and Symfony coding standards.〔http://symfony.com/doc/current/contributing/code/standards.html#structure〕
== Example ==
Usually a conditional statement would be written as:

if ( $value == 52 )
// Reads like: "If the value is equal to 52..."

Yoda conditions describe the same expression, but reversed:

if ( 52 == $value )
// Reads like: "If 52 equals the value..."

The constant is written to the left of the comparison operator, and the variable whose value is being checked against the constant is written to the right. This order is comparable to the non-standard speaking style of Yoda, which is roughly object–subject–verb (e.g., “When nine hundred years old you reach, look as good you will not.").

抄文引用元・出典: フリー百科事典『 ウィキペディア(Wikipedia)
ウィキペディアで「Yoda conditions」の詳細全文を読む



スポンサード リンク
翻訳と辞書 : 翻訳のためのインターネットリソース

Copyright(C) kotoba.ne.jp 1997-2016. All Rights Reserved.